package cn.bone.motan.jingzhouArea.server;

import cn.bone.motan.common.MoRequest;
import cn.bone.motan.common.MoResponse;
import cn.bone.motan.demo1.api.ServerApi;
import cn.bone.motan.jingzhouArea.data.RouteData;
import cn.bone.motan.jingzhouArea.data.TempConfig;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * Created by MD-01 on 2017/3/14.
 */
@Service
public class LocalService implements ServerApi {

    private Logger logger = LoggerFactory.getLogger("来自gateway的请求");

    @Override
    public MoResponse execute(MoRequest request) {

        logger.info("荆州区server处理荆州区gateway的请求");
        RouteData routeData = TempConfig.routeData;
        return MoResponse.ok(JSON.toJSONString(routeData));
    }
}
